import { api, request } from '@/api/request'

//? 获取所有用户
export const getAllUsers = () => request(api.get, '/api/admin/users')

//? 根据ID获取单个用户
export const getUserById = (userId) => request(api.get, `/api/admin/users/${userId}`)

//? 创建用户
export const createUser = (user) => request(api.post, '/api/admin/users', user)

//? 更新用户
export const updateUserById = (user) => request(api.put, `/api/admin/users/${user.id}`, user)

//? 删除用户
export const deleteUserById = (userId) => request(api.delete, `/api/admin/users/${userId}`)